﻿using System;
using System.Text;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Rison.Web.Common;
using Rison.BusinessFacade.Common;
using Rison.BusinessFacade.Facade.XT;

namespace Rison.Web.ascx
{
    public partial class WebHeader : System.Web.UI.UserControl
    {
        protected bool Logined
        {
            get { return CurrentLoginedUser.Logined; }
        }

        protected string UrlBase
        {
            get { return  PageGlobalParams.PageUrlBase2 ; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.LabUserName.Text = CurrentLoginedUser.UserName;
                //labCurDay.Text = DateTime.Now.ToString("yyyy年M月d日") + "&nbsp;&nbsp;" + GlobalParams.Instance.GetWeekName(DateTime.Now.DayOfWeek.GetHashCode());
                //2011年3月15日 星期二               
            }

            if (!Logined)
            {
                btnLogout_Click(sender, e);
            }

        }

        private void DisplayCurrentDate()
        {
        }

        protected void btnLogout_Click(object sender, EventArgs e)
        {
            CurrentLoginedUser.ClearUserSession();
            Response.Redirect(PageGlobalParams.PageUrlBase + "Login.aspx");
        }
    }
}